﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class human
    {
        List<human> chi =  new List<human>();
        string name, susname;
        int agen;
        bool male;
        man father;
        woman mather;
        List<human> cars = new List<human>();

        public virtual  string MyInfo()
        {
 string str;
          string resaut = "Меня зовут "+name+" я ";
          
           if(chi!= null&& chi.Count > 0)
           {
               resaut+=" мои дети :";
           foreach(human child in chi)
               resaut+=" "+ child  ;
           }
            
          return resaut;
        }
        public human(man Father, woman Mather, string name)
        {
            if (father != null) 
            {
                father.chi.Add(this);
            } 
            father = Father;
            if (mather != null)
            {
                mather.chi.Add(this);
            } 
            mather = Mather;

            this.name = name;
        }
    }
       
        class woman : human
        {//public 
            string[]ch = new string[10] { "Tanya", "Kolya", " Olga", "Alexander", "Joe", "Yulia", "Andrew", " Vladimir", "Alex", " Natasha" };
            public woman(man Father, woman Mather, string name)
                : base(Father, Mather, name)
            {
            }
        }
        class man : human
        {
            string[] ch = new string[10] { "Tanya", "Kolya", " Olga", "Alexander", "Joe", "Yulia", "Andrew", " Vladimir", "Alex", " Natasha" };
            public man(man Father, woman Mather, string name)
                : base(Father, Mather, name)
            {
            }

        }


        class Program
        {
            static void Main(string[] args)
            {
                man Adam = new man(null, null, "Adam");
                woman Eva = new woman(null, null, "Eva");
                man Kain = new man(Adam, Eva, "Kain");
                man Avel = new man(Adam, Eva, "Avel");
                man Sif = new man(Adam, Eva, "Sif");
                woman Avan = new woman(Adam, Eva, "Avan");
                man Enoch = new man(Kain, Avan, "Enoch");
                Console.WriteLine(Adam.MyInfo());
                Console.WriteLine(Eva.MyInfo());
                Console.WriteLine(Kain.MyInfo());
                Console.ReadLine();
            }
        }
    }

